package com.feifan.monthhelper.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.Date;

/**
 * 月经统计分析
 */
public class MenstrualSperiodStatisticsBean implements Parcelable {
    private Date startDate;
    private Date endDate;
    private int menstrualPeriod;
    private int delayDays;
    //月经量
    private int bloodLevel = -1;
    //疼痛程度
    private int painLevel = -1;
    //经期状态，-1：提前，0：正常，1：推迟
    private int state;
    //得分
    private int score;

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public int getMenstrualPeriod() {
        return menstrualPeriod;
    }

    public void setMenstrualPeriod(int menstrualPeriod) {
        this.menstrualPeriod = menstrualPeriod;
    }

    public int getDelayDays() {
        return delayDays;
    }

    public void setDelayDays(int delayDays) {
        this.delayDays = delayDays;
    }

    public int getBloodLevel() {
        return bloodLevel;
    }

    public void setBloodLevel(int bloodLevel) {
        this.bloodLevel = bloodLevel;
    }

    public int getPainLevel() {
        return painLevel;
    }

    public void setPainLevel(int painLevel) {
        this.painLevel = painLevel;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public interface MenstrualState {
        int DELAY = -1;
        int NORMAL = 0;
        int AHEAD = 1;
    }

    public MenstrualSperiodStatisticsBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.startDate != null ? this.startDate.getTime() : -1);
        dest.writeLong(this.endDate != null ? this.endDate.getTime() : -1);
        dest.writeInt(this.menstrualPeriod);
        dest.writeInt(this.delayDays);
        dest.writeInt(this.bloodLevel);
        dest.writeInt(this.painLevel);
        dest.writeInt(this.state);
        dest.writeInt(this.score);
    }

    protected MenstrualSperiodStatisticsBean(Parcel in) {
        long tmpStartDate = in.readLong();
        this.startDate = tmpStartDate == -1 ? null : new Date(tmpStartDate);
        long tmpEndDate = in.readLong();
        this.endDate = tmpEndDate == -1 ? null : new Date(tmpEndDate);
        this.menstrualPeriod = in.readInt();
        this.delayDays = in.readInt();
        this.bloodLevel = in.readInt();
        this.painLevel = in.readInt();
        this.state = in.readInt();
        this.score = in.readInt();
    }

    public static final Creator<MenstrualSperiodStatisticsBean> CREATOR = new Creator<MenstrualSperiodStatisticsBean>() {
        @Override
        public MenstrualSperiodStatisticsBean createFromParcel(Parcel source) {
            return new MenstrualSperiodStatisticsBean(source);
        }

        @Override
        public MenstrualSperiodStatisticsBean[] newArray(int size) {
            return new MenstrualSperiodStatisticsBean[size];
        }
    };
}
